<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

		<!-- play.html
			m: display size
			d: current directory
			p: playlist page
			type: type of item to play
				0 = nothing
				1 = audio/video without transcoding
				2 = video with audio transcoding
				3 = audio/video with transcoding
				4 = picture
				5 = playlist item
				6 = full playlist
				7 = channel number
			file: path of the item to play
			name: name of the item to play
			control: playlist action
			item: channel or playlist item number
			seek: seek parameter
		-->
	<vlc id="rpn" param1="m 'm' url_extract store" />
	<vlc id="rpn" param1="dir 'd' url_extract store" />
	<vlc id="if" param1="dir value '' strcmp 0 =" />
		<vlc id="rpn" param1="dir '~' store" />
	<vlc id="end" />
	<vlc id="rpn" param1="dir dir value realpath store" />
	<vlc id="rpn" param1="d dir value url_encode store" />

	<vlc id="rpn" param1="p 'p' url_extract store" />
	<vlc id="rpn" param1="u 'm=' m value strcat '&p=' strcat p value strcat '&d=' strcat d value strcat store" />
	<vlc id="rpn" param1="v u value '%' '%%' str_replace store" />

		<vlc id="if" param1="m value '' strcmp 0 =" />
			<vlc id="rpn" param1="m 100 store" />
		<vlc id="end" />
		<vlc id="if" param1="m value 50 <" />
			<vlc id="rpn" param1="m 50 store" />
		<vlc id="end" />
		<vlc id="if" param1="m value 100 >" />
			<vlc id="rpn" param1="m 100 store" />
		<vlc id="end" />

		<vlc id="rpn" param1="file 'file' url_extract store" />
		<vlc id="rpn" param1="name 'name' url_extract store" />
		<vlc id="rpn" param1="type 'type' url_extract store" />

		<vlc id="rpn" param1="qfile '\'' file value addslashes strcat '\'' strcat store" />

		<!-- audio/video without transcoding -->
		<vlc id="if" param1="type value 1 =" />
			<vlc id="rpn" param1="qfile value name value playlist_add vlc_play" />
		<vlc id="end" />

		<!-- video with audio transcoding -->
		<vlc id="if" param1="type value 2 =" />
			<vlc id="rpn" param1="qfile value ' :sout=#transcode:std :sout-transcode-ab=256 :sout-transcode-acodec=mpga :sout-transcode-channels=2 :sout-transcode-scodec=dvbs' strcat name value playlist_add vlc_play" />
		<vlc id="end" />

		<!-- audio/video with transcoding -->
		<vlc id="if" param1="type value 3 =" />
			<vlc id="rpn" param1="qfile value ' :sout=#transcode:std :sout-transcode-ab=256 :sout-transcode-acodec=mpga :sout-transcode-channels=2 :sout-transcode-vb=9000 :sout-transcode-vcodec=mp2v :sout-transcode-vt=1000000 :sout-transcode-fps=25.0 :sout-ffmpeg-keyint=24 :sout-ffmpeg-interlace :no-sout-ffmpeg-interlace-me :file-caching=1000 :sout-transcode-soverlay' strcat name value playlist_add vlc_play" />
		<vlc id="end" />

		<!-- picture -->
		<vlc id="if" param1="type value 4 =" />
			<vlc id="rpn" param1="'fake: :sout=#transcode:std :fake-width=720 :fake-height=576 :fake-aspect-ratio=4:3 :fake-keep-ar :fake-deinterlace :deinterlace-mode=blend :sout-transcode-vb=9000 :sout-transcode-vcodec=mp2v :sout-transcode-vt=1000000 :sout-ffmpeg-keyint=8 :sout-ffmpeg-interlace :no-sout-ffmpeg-interlace-me :fake-file=' qfile value strcat name value playlist_add vlc_play" />
		<vlc id="end" />

		<!-- playlist item -->
		<vlc id="if" param1="type value 5 =" />
			<vlc id="rpn" param1="control 'control' url_extract store" />
			<vlc id="rpn" param1="item 'item' url_extract store" />
			<vlc id="rpn" param1="seek 'seek' url_extract store" />
			<vlc id="if" param1="control value 'play'     strcmp 0 =" /><vlc id="rpn" param1="item value vlc_play"     /><vlc id="end" />
			<vlc id="if" param1="control value 'stop'     strcmp 0 =" /><vlc id="rpn" param1="item value vlc_stop"     /><vlc id="end" />
			<vlc id="if" param1="control value 'pause'    strcmp 0 =" /><vlc id="rpn" param1="item value vlc_pause"    /><vlc id="end" />
			<vlc id="if" param1="control value 'next'     strcmp 0 =" /><vlc id="rpn" param1="item value vlc_next"     /><vlc id="end" />
			<vlc id="if" param1="control value 'previous' strcmp 0 =" /><vlc id="rpn" param1="item value vlc_previous" /><vlc id="end" />
			<vlc id="if" param1="control value 'seek'     strcmp 0 =" /><vlc id="rpn" param1="seek value vlc_seek"     /><vlc id="end" />

			<vlc id="if" param1="control value 'empty' strcmp 0 =" />
				<vlc id="rpn" param1="playlist_empty" />
			<vlc id="end" />
		<vlc id="end" />

		<!-- full playlist -->
		<vlc id="if" param1="type value 6 =" />
			<vlc id="rpn" param1="playlist_empty qfile value name value playlist_add vlc_play" />
			<vlc id="foreach" param1="pl" param2="playlist" />
				<vlc id="if" param1="pl.type value 'Node' strcmp" />
				
				<vlc id="end" />
			<vlc id="end" />
			
		<vlc id="end" />

		<!-- channel number -->
		<vlc id="if" param1="type value 7 =" />
			<vlc id="rpn" param1="item 'item' url_extract store" />
			<vlc id="rpn" param1="node 1 store" />
			<vlc id="foreach" param1="pl" param2="playlist" />
				<vlc id="if" param1="pl.type value 'Node' strcmp" />
					<vlc id="if" param1="node value item value =" />
						<vlc id="rpn" param1="name pl.name value store" />
						<vlc id="rpn" param1="pl.index value vlc_play" />
					<vlc id="end" />
					<vlc id="rpn" param1="node node value 1 + store" />
				<vlc id="end" />
			<vlc id="end" />
		<vlc id="end" />


		<vlc id="if" param1="type value 6 !=" />
		<vlc id="end" />